﻿<%@ Page Language="C#" AutoEventWireup="true" CodeFile="zzb.aspx.cs" Inherits="ybqy_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta name="viewport" content="initial-scale=1.0, user-scalable=no" />
<style type="text/css">
body, html,#allmap {width: 100%;height: 100%;overflow: hidden;margin:0;}
#l-map{height:100%;width:78%;float:left;border-right:2px solid #bcbcbc;}
#r-result{height:100%;width:20%;float:left;}
</style>
<script type="text/javascript" src="http://api.map.baidu.com/api?v=1.5&ak=F7b6c377600b9c408d8c909d815a5e89"></script>
    <title></title>
</head>
<body>
 <div id="l-map"></div>
   <form id="form1" runat="server">
<div id="r-result">
    请在地图上点击，然后按确定<br />
    <br />
    <br />
    经度<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
    <br />
    <br />
    纬度<asp:TextBox ID="TextBox2" runat="server"></asp:TextBox>
    <br />
    <br />
    <br />
    <asp:Button ID="Button1" runat="server" Text="确定" onclick="Button1_Click" 
        style="height: 21px" />
    &nbsp;<br />
   </div>
    <div>
    
    </div>
    </form>
</body>
</html>
<script type="text/javascript">

    // 百度地图API功能
    var map = new BMap.Map("l-map");
    map.centerAndZoom("茂名", 12);                   // 初始化地图,设置城市和地图级别。
    map.addControl(new BMap.NavigationControl());               // 添加平移缩放控件
    map.addControl(new BMap.ScaleControl());                    // 添加比例尺控件
    map.enableScrollWheelZoom();                            //启用滚轮放大缩小

    map.addEventListener("click", function (e) {
        document.getElementById("TextBox1").value = e.point.lng;
        document.getElementById("TextBox2").value = e.point.lat;
    });

    function fh() {
        window.location.href = '1-1.aspx'; 
    }

</script>
